home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / program / pkunexap.zip / UNZIP.Frm < prev    next >
Text File  |  1996-08-01  |  7KB  |  241 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMain 
  3.    Caption         =   "Zipping Test Form"
  4.    ClientHeight    =   3300
  5.    ClientLeft      =   2580
  6.    ClientTop       =   1980
  7.    ClientWidth     =   7170
  8.    Height          =   3720
  9.    Icon            =   "UNZIP.frx":0000
  10.    Left            =   2520
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   3300
  13.    ScaleWidth      =   7170
  14.    Top             =   1620
  15.    Width           =   7290
  16.    Begin VB.Frame Frame1 
  17.       Height          =   3270
  18.       Left            =   0
  19.       TabIndex        =   0
  20.       Top             =   0
  21.       Width           =   7155
  22.       Begin VB.CommandButton btnGetCC 
  23.          Caption         =   "Get C&&C Files"
  24.          Height          =   435
  25.          Left            =   5670
  26.          TabIndex        =   16
  27.          Top             =   840
  28.          Width           =   1380
  29.       End
  30.       Begin VB.TextBox txtTextFile 
  31.          Height          =   285
  32.          Left            =   1785
  33.          TabIndex        =   15
  34.          Text            =   "*.txt;*.doc"
  35.          Top             =   2835
  36.          Width           =   3690
  37.       End
  38.       Begin VB.TextBox txtMissionIni 
  39.          Height          =   285
  40.          Left            =   1785
  41.          TabIndex        =   13
  42.          Text            =   "Mission.ini"
  43.          Top             =   2520
  44.          Width           =   3690
  45.       End
  46.       Begin VB.TextBox txtSaveGameName 
  47.          Height          =   285
  48.          Left            =   1785
  49.          TabIndex        =   12
  50.          Text            =   "SaveGame.*"
  51.          Top             =   2205
  52.          Width           =   3690
  53.       End
  54.       Begin VB.FileListBox fileZipName 
  55.          Height          =   450
  56.          Left            =   1470
  57.          Pattern         =   "*.zip"
  58.          TabIndex        =   9
  59.          Top             =   945
  60.          Width           =   4005
  61.       End
  62.       Begin VB.FileListBox fileExtracted 
  63.          Height          =   645
  64.          Left            =   1470
  65.          TabIndex        =   8
  66.          Top             =   1470
  67.          Width           =   4005
  68.       End
  69.       Begin VB.TextBox txtExtractToPath 
  70.          Height          =   285
  71.          Left            =   1470
  72.          TabIndex        =   2
  73.          Text            =   "c:\c&c\temp"
  74.          Top             =   630
  75.          Width           =   4005
  76.       End
  77.       Begin VB.CommandButton btnExtract 
  78.          Caption         =   "&Extract Files"
  79.          Default         =   -1  'True
  80.          Height          =   540
  81.          Left            =   5670
  82.          TabIndex        =   3
  83.          Top             =   210
  84.          Width           =   1380
  85.       End
  86.       Begin VB.TextBox txtPKPath 
  87.          Height          =   285
  88.          Left            =   1470
  89.          TabIndex        =   1
  90.          Text            =   "c:\zipper\pkunzip.exe"
  91.          Top             =   315
  92.          Width           =   4005
  93.       End
  94.       Begin VB.Label Label8 
  95.          Caption         =   "Text File"
  96.          Height          =   225
  97.          Left            =   105
  98.          TabIndex        =   14
  99.          Top             =   2835
  100.          Width           =   1590
  101.       End
  102.       Begin VB.Label Label7 
  103.          Caption         =   "Mission Ini:"
  104.          Height          =   225
  105.          Left            =   105
  106.          TabIndex        =   11
  107.          Top             =   2520
  108.          Width           =   1590
  109.       End
  110.       Begin VB.Label Label6 
  111.          Caption         =   "Save Game FileName:"
  112.          Height          =   225
  113.          Left            =   105
  114.          TabIndex        =   10
  115.          Top             =   2205
  116.          Width           =   1590
  117.       End
  118.       Begin VB.Label Label5 
  119.          Caption         =   "Files Extracted:"
  120.          Height          =   225
  121.          Left            =   105
  122.          TabIndex        =   7
  123.          Top             =   1470
  124.          Width           =   1275
  125.       End
  126.       Begin VB.Label Label4 
  127.          AutoSize        =   -1  'True
  128.          Caption         =   "Extract To Path:"
  129.          Height          =   195
  130.          Left            =   105
  131.          TabIndex        =   6
  132.          Top             =   630
  133.          Width           =   1275
  134.       End
  135.       Begin VB.Label Label3 
  136.          AutoSize        =   -1  'True
  137.          Caption         =   "Zip File:"
  138.          Height          =   195
  139.          Left            =   105
  140.          TabIndex        =   5
  141.          Top             =   945
  142.          Width           =   1290
  143.       End
  144.       Begin VB.Label Label2 
  145.          AutoSize        =   -1  'True
  146.          Caption         =   "PKUNZIP Path:"
  147.          Height          =   195
  148.          Left            =   105
  149.          TabIndex        =   4
  150.          Top             =   315
  151.          Width           =   1275
  152.       End
  153.    End
  154. End
  155. Attribute VB_Name = "frmMain"
  156. Attribute VB_Creatable = False
  157. Attribute VB_Exposed = False
  158. Option Explicit
  159.  
  160.  
  161.  
  162.  
  163. Private Sub btnExtract_Click()
  164. Dim PKPath$, ZipPath$, ExToPath$, CommandLine$
  165. Dim I As Long, J As Long
  166. Dim Ret As Boolean
  167. 'Store the various user inputs into varibles
  168. PKPath = UCase(txtPKPath.Text)
  169. ZipPath = "D:\ARCHIVES\" & UCase(fileZipName.List(fileZipName.ListIndex))
  170. ExToPath = UCase(txtExtractToPath.Text)
  171. 'Delete all files in ExToPath, then we can get the unzipped name
  172. 'If you dont unzip to an empty directory you might get the wrong files returned
  173. 'This line assumes every file is okay to be deleted
  174. Kill ExToPath & "\*.*"
  175. fileExtracted.Path = ExToPath
  176. 'Combine the varibles and command line stings to
  177. 'run pkunzip as you would from dos
  178. ' -o -en overwrites anything thats there and extracts in name order
  179. 'change if needed
  180. CommandLine = PKPath & " -o -en " & ZipPath & " " & ExToPath
  181. MsgBox CommandLine
  182. Ret = ShellAndClose(CommandLine)
  183. If Ret = False Then
  184.     MsgBox "An error occured in the shelling process"
  185. End If
  186. 'Click the get CC files
  187. btnGetCC.Value = True
  188. End Sub
  189.  
  190.  
  191.  
  192.  
  193. Private Sub btnGetCC_Click()
  194. 'Get SaveGame file
  195. fileExtracted.Pattern = "SaveGame.*"
  196. fileExtracted.Refresh
  197. If fileExtracted.ListCount <> 0 Then
  198.     txtSaveGameName.Text = fileExtracted.List(0)
  199. Else
  200.     txtSaveGameName.Text = "File Not Found"
  201. End If
  202. 'Get Mission.ini
  203. fileExtracted.Pattern = "Mission.Ini"
  204. fileExtracted.Refresh
  205. If fileExtracted.ListCount <> 0 Then
  206.     txtMissionIni.Text = fileExtracted.List(0)
  207. Else
  208.     txtMissionIni.Text = "File Not Found"
  209. End If
  210. 'Get txt and/or doc file
  211. fileExtracted.Pattern = "*.txt"
  212. fileExtracted.Refresh
  213. If fileExtracted.ListCount <> 0 Then
  214.     txtTextFile.Text = fileExtracted.List(0)
  215. Else
  216.     fileExtracted.Pattern = "*.doc"
  217.     fileExtracted.Refresh
  218.     If fileExtracted.ListCount <> 0 Then
  219.         txtTextFile.Text = fileExtracted.List(0)
  220.     Else
  221.         txtTextFile.Text = "No files found"
  222.     End If
  223. End If
  224. fileExtracted.Pattern = "*.*"
  225. End Sub
  226.  
  227.  
  228. Private Sub fileZipName_DblClick()
  229. btnExtract.Value = True
  230. End Sub
  231.  
  232.  
  233. Private Sub Form_Load()
  234. fileZipName.Path = "D:\archives"
  235. 'Set up file box
  236. fileExtracted.Pattern = "*.*"
  237.  
  238. End Sub
  239.  
  240.  
  241.